import * as logger from 'pinus-logger';
import * as Constants from './constants';
import { Application } from '../application';

/**
 * Configure pinus logger
 */
export function configure(app: Application, filename: string) {
  let log4jsOpts = app.get(Constants.RESERVED.LOG4JS_OPTS);
  log4jsOpts = log4jsOpts || {};
  log4jsOpts.serverId = app.getServerId();
  log4jsOpts.base = app.getBase();
  logger.configure(filename, log4jsOpts);
}
